using System.Linq;
using Comteck.Entities.Sys;

namespace Comteck.Ktt.Services.SeedData {
  /// <summary>
  /// 菜单权限
  /// </summary>
  public class _20250429001_MenuAuth : IDataSeed {
    /// <summary>
    /// 
    /// </summary>
    /// <param name="context"></param>
    public void Init(AppDbContext context) {
      // 菜单
      if (!context.MenuAuth.Any()) {
        context.MenuAuth.Add(new MenuAuth() {
          Id = "10",
          Parent_Id = "",
          Name = "系统",
          Show_Mode = 0,
          Status = 1,
        });
        context.MenuAuth.Add(new MenuAuth() {
          Id = "1010",
          Parent_Id = "10",
          Name = "参数管理",
          Show_Mode = 0,
          Status = 1,
          Form_Assembly_Name = "Comteck.Ktt.WinUI",
          Form_Path = "Comteck.Ktt.WinUI.Sys.FrmParameterAdmin"
        });
        context.MenuAuth.Add(new MenuAuth() {
          Id = "1020",
          Parent_Id = "10",
          Name = "打印模版管理",
          Show_Mode = 0,
          Status = 1,
          Form_Assembly_Name = "Comteck.Ktt.WinUI",
          Form_Path = "Comteck.Ktt.WinUI.Sys.FrmPrintTemplateAdmin"
        });

        context.MenuAuth.Add(new MenuAuth() {
          Id = "20",
          Parent_Id = "",
          Name = "商品",
          Show_Mode = 0,
          Status = 1,
        });
        context.MenuAuth.Add(new MenuAuth() {
          Id = "2010",
          Parent_Id = "20",
          Name = "商品管理",
          Show_Mode = 0,
          Status = 1,
          Form_Assembly_Name = "Comteck.Ktt.WinUI",
          Form_Path = "Comteck.Ktt.WinUI.Goods.ProductAdmin"
        });


        context.MenuAuth.Add(new MenuAuth() {
          Id = "40",
          Parent_Id = "",
          Name = "订单",
          Show_Mode = 0,
          Status = 1,
        });

        context.MenuAuth.Add(new MenuAuth() {
          Id = "4010",
          Parent_Id = "40",
          Name = "自提点标签管理",
          Show_Mode = 0,
          Status = 1,
          Form_Assembly_Name = "Comteck.Ktt.WinUI",
          Form_Path = "Comteck.Ktt.WinUI.Orders.FrmSelfOrgTagAdmin"
        });

        context.MenuAuth.Add(new MenuAuth() {
          Id = "4020",
          Parent_Id = "40",
          Name = "自提点管理",
          Show_Mode = 0,
          Status = 1,
          Form_Assembly_Name = "Comteck.Ktt.WinUI",
          Form_Path = "Comteck.Ktt.WinUI.Orders.FrmSelfOrgAdmin"
        });

        context.MenuAuth.Add(new MenuAuth() {
          Id = "4030",
          Parent_Id = "40",
          Name = "订单管理",
          Show_Mode = 0,
          Status = 1,
          Form_Assembly_Name = "Comteck.Ktt.WinUI",
          Form_Path = "Comteck.Ktt.WinUI.Orders.FrmSaleOrderAdmin"
        });

        context.SaveChanges();
      }
    }
  }
}
